<?php use_helper('Date') ?>
<br />
<br />
		<div class="searchbar">
				<?php include_partial('main/search',array('form' => $form)) ?>
		</div>
<br />

	<?php if($s == 'MC'):?>
<h1>Search Results</h1>	<br />
<?$c = count($list);
if($c==0)
{
  echo "<br /><h3>Oppppsss...! Our database did not find any records.</h3> <br />";
} 
?>
<table class="sortable" id="sortable_example" >
	  <thead>
	    <tr>
	      <th>MCID NO.</th>
	      <th>MC Name</th>
	      <th>Client Type</th>
	      <th>Client Since</th>
	    </tr>
	  </thead>
  <tbody>
     <?php foreach ($list as $client): ?>
    <tr> 
      <td><a href="<?php echo url_for('mc/show?id='.$client['id']) ?>"><?php echo $client->getmc_no() ?></a></td>
      <td><?php echo $client->getname() ?></td>
      <td><?php echo $client->getclient_type() ?></td>
      <td><?php echo $client->getcreated_at() ?></td>
    </tr>  <?php endforeach; ?>
    </tbody>
</table>
<br />
	<?php elseif($s == 'PX'):?>	
	<h1>Search Results</h1>	<br />
<?$cc = count($list2);
if($cc==0)
{
  echo "<br /><h3>Oppppsss...! Our database did not find any records.</h3> <br />";
} 
?>		
<table class="sortable" id="sortable_example" >
	  <thead>
	    <tr>
	      <th>PX NO.</th>
	      <th>Passenger Name</th>
	      <th>Sex</th>
	      <th>Age</th>
	      <th>Client Since</th>
	    </tr>
	  </thead>
  <tbody>
      <?php foreach ($list2 as $px): ?>
    <tr>
	  <td><a href="<?php echo url_for('px/show?id='.$px['id']) ?>"><?php echo $px->getpx_number() ?></a></td>
      <td><?php echo $px->getPerson()->getfirst_name().' '.$px->getPerson()->getlast_name() ?></td>
      <td><?php echo $px->getsex() ?></td>
      <td><?php echo $px->getage_to_date() ?></td>
      <td><?php echo $px->getPerson()->getcreated_at() ?></td>
    </tr>
	<?php endforeach; ?>
    </tbody>
</table>
<br />

<?php endif; ?>